﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CtrlWeekEditFunds3.ascx.cs"
    Inherits="Thksoft.UserCotrols.CtrlWeekEditFunds3" %>
<link href="../../CSS/Main.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/javascript">
    function PrintApplyBill() {
        var va = document.getElementById("<%=this.hidId.ClientID %>").value;
        window.showModalDialog("../../BusinessExpansion/Print/MonthPrint.aspx?PID=" + va, "", "dialogHeight:768px; dialogWidth:1024px;");

    }

    function NoNumber() {
        //回车、上、下求和
        if (event.keyCode == 13 || event.keyCode == 40 || event.keyCode == 38) {
            // sum();
            return true;
        }
        if (event.keyCode == 110 || event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 46 || event.keyCode == 190) {
            return true;
        }
        if (event.keyCode != 8) {
            if (!((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105))) {
                return false;
            }
        }
        return true;
    }
</script>
<script type="text/javascript">

    var app1 = {};
    app1.ToDetails = function (applyId, type, proId, code) {
        var arry = [
                { Code: "T1", Url: "/Module/ProjectDetails/IncomeBusiness.aspx", Title: "主营业务收入周明细表" },
                { Code: "T2", Url: "/Module/ProjectDetails/OutcomeGasMoney.aspx", Title: "天然气购入周明细表" },
                { Code: "T3", Url: "/Module/ProjectDetails/OutcomeThree.aspx", Title: "安装外包费用周明细表" },
                { Code: "T4", Url: "/Module/ProjectDetails/OutcomeFour.aspx", Title: "材料费用周明细表" },
                { Code: "T5", Url: "/Module/ProjectDetails/OutcomeFive.aspx", Title: "大修费用周明细表" },
                { Code: "T6", Url: "/Module/ProjectDetails/OutcomeInvestment1.aspx", Title: "城市管网项目周明细表"}];
        for (var i = 0; i < arry.length; i++) {
            if (arry[i].Code == code) {
                var url = arry[i].Url;
                url += "?ApplyId=" + applyId;
                url += "&ProId=" + proId;
                url += "&State=" + type;
                url += "&type=2"; //判断是0计划上报 1单位审批 2总部审批
                //直接调用主页面的Layer  https://www.layui.com/doc/modules/layer.html
                var option = {
                    title: arry[i].Title,
                    type: 2,
                    content: [url, 'no'],
                    area: ["850px", "530px"],
                    scrollbar: false,
                    success: function (laydom, index) {
                        //添加刷新事件
                        $(laydom)[0].ReLoad = function () {
                            $("#<%=Button1.ClientID %>").click();
                        };
                    }
                };
                top.layer.open(option);
                return;
            }
        }
        console.log("没有找到匹配的路由");
    };
    app1.Data = {};
    app1.Init = function () {

    }
    app1.Ajax = $.post;

    app1.Init();
</script>
<%--周总部审批金额--%>
<asp:HiddenField ID="HiddenField3" runat="server" />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td valign="top">
            <div id="div" style="width: 95%; border: 0;">
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="text-align: center; font-size: 16px; font-weight: bold; height: 30px;">周资金计划（
                            <asp:Label ID="lblyear" runat="server" />
                            ）
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div style="float: left; width: 100%;">
                                <table border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
                                    <tr>
                                        <td style="width: 100px; padding-right: 3px; text-align: right;">填报单位：
                                        </td>
                                        <td style="text-align: left; padding-left: 3px;">
                                            <asp:Label ID="lbldw" runat="server" />
                                        </td>
                                        <td></td>
                                        <td style="width: 100px;">计量单位：万元
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:GridView ID="gvMonthFunds" runat="server" Width="100%" CssClass="cont_list"
                                AutoGenerateColumns="False" OnRowDataBound="gvMonthFunds_RowDataBound">
                                <Columns>
                                    <asp:TemplateField HeaderText="编号" HeaderStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:HiddenField runat="server" ID="HiddenField2" Value='<%#Eval("DETAILS_CODE") %>' />
                                            <asp:HiddenField runat="server" ID="HiddenField1" Value='<%#Eval("IF_DETAILS") %>' />
                                            <asp:Label ID="lblProID" runat="server" Text='<%#Eval("n_proid") %>'></asp:Label>
                                            <asp:Label ID="lblReamount" runat="server" Text='<%#Eval("n_amount") %>' Visible="false"></asp:Label>
                                            <asp:Label ID="lbltype" runat="server" Text='<%#Eval("n_type") %>' Visible="false"></asp:Label>
                                            <asp:Label ID="lblId" runat="server" Text='<%#Eval("N_WEEKDETAIL_ID") %>' Visible="false"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="项目名称">
                                        <ItemTemplate>
                                            <asp:Label ID="txtProjectName" runat="server" Text='<%#Eval("c_proname") %>'></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Width="200px" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="N_MONTHAMOUNT" HeaderText="月度资金计划审批金额" ItemStyle-HorizontalAlign="Center"
                                        ItemStyle-Width="100px" />
                                    <asp:BoundField DataField="N_SYAMOUNT" HeaderText="本月累计已拨付资金" ItemStyle-HorizontalAlign="Center"
                                        ItemStyle-Width="100px" />

                                    <asp:TemplateField HeaderText="本周上报资金计划" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:Label ID="lblamount" runat="server" CssClass="sum" Text='<%#Eval("n_amount1") %>'></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Width="100px" />
                                    </asp:TemplateField>

                                    <asp:BoundField DataField="c_remark" HeaderText="备注" ItemStyle-HorizontalAlign="Center"
                                        ItemStyle-Width="100px" />

                                    <asp:TemplateField HeaderText="审核资金计划" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:Label ID="lblMonthjh" runat="server" CssClass="sum" Text='<%#Eval("n_amount2") %>'
                                                Visible="false"></asp:Label>
                                            <asp:TextBox ID="txtNowMonth" runat="server" Width="90%" CssClass="xmtxt" Text='<%#Eval("n_amount2")%>'></asp:TextBox>
                                            <%--  onkeydown="return NoNumber()"--%>
                                        </ItemTemplate>
                                        <HeaderStyle Width="100px" />
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="审批意见" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtremark" Width="99%" CssClass="txt" runat="server" Text='<%#Eval("c_remark2")%>'></asp:TextBox>
                                            <asp:Label ID="lblreMark" runat="server" Text='<%#Eval("c_remark2") %>' Visible="false"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <EmptyDataTemplate>
                                    没有你所查询的数据
                                </EmptyDataTemplate>
                            </asp:GridView>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: left; padding-left: 5px; height: 30px;">编制依据及事由：
                            <asp:Label ID="lblBzyj" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: center;">
                            <input type="hidden" runat="server" id="hidId" />
                            申请人：<asp:Label ID="lblUser" runat="server" />
                            &nbsp;&nbsp;&nbsp; &nbsp;申请时间：
                            <asp:Label ID="lblTime" runat="server" /><input type="hidden" runat="server" id="Hidden1" />
                            &nbsp;&nbsp;&nbsp; &nbsp;
                            <asp:Button ID="Button1" runat="server" Text="刷新" CssClass="hide" OnClick="ReLoadClick" />
                            <asp:Button ID="btnEdtSum" runat="server" Text="求和" CssClass="bt_css_s" OnClick="btnEdtSum_Click" />
                            <asp:Button ID="btnEdit" Style="display: none" runat="server" Text="修改" CssClass="bt_css_s"
                                OnClick="btnEdit_Click" />
                            <input type="button" value="修改" class="bt_css_s" onclick="top.MessageBox.Show({Type:'confirm',Msg:'确定修改周资金计划吗?',YesCallback:function(index, layero){top.layer.close(index);document.getElementById('<%=this.btnEdit.ClientID %>').click();}})" />
                            <asp:Button ID="btnPrint" runat="server" Text="打印" CssClass="bt_css_s" OnClientClick="return PrintApplyBill();"
                                Visible="false" />
                        </td>
                    </tr>
                </table>
            </div>
        </td>
    </tr>
</table>